var member = "my name is Mate"; var last2 = member.slice(-2); alert(last2); // "te"
const id = "ctl03_Tabs1"; console.log(id.slice(id.length - 5)); //Outputs: Tabs1 console.log(id.slice(id.length - 1)); //Outputs: 1